<?php
//在Joomla里设置facebook的meta信息：
//标签的说明文档：http://developers.facebook.com/docs/opengraph#started
//@author sanywork 
//@url http://www.sanywork.com/
function setFBMetaData($data){
	$meta = array();
	//title:
	if ($data->title){
		$meta[] = '<meta property="og:title" content="'.$data->title.'" />'; 
	}
	
	// type:
	if ($data->type){
		$meta[] = '<meta property="og:type" content="'.$data->type.'" />'; 
	}
	
	//url:
	if ($data->url){
		$meta[] = '<meta property="og:url" content="'.$data->url.'" />'; 
	}
	
	//sitename:
	if (!$data->site_name){
		$data->site_name = 'Investomy';
	}
	$meta[] = '<meta property="og:site_name" content="'.$data->site_name.'" />';
	
	//image:
	if ($data->image){
		$meta[] = '<meta property="og:image" content="'.$data->image.'" />'; 
	}
	
	// fb admins:
	if ($data->fbAdmins){
		$meta[] = '<meta property="fb:admins" content="'.$data->fbAdmins.'"/>'; 
	}
	
	//description:
	if ($data->description){
		$meta[] = '<meta property="og:description" content="'.$data->description.'" />'; 
	}
	
	$document =& JFactory::getDocument();
	$array['custom']=$meta;
	$document->setHeadData($array);
}
?>